// app.js
App({
  onLaunch: function (options) {
    // 获取用户openid
    wx.login({
      success: res => {
        wx.request({
          url: 'http://192.168.43.159:8080/login',
          data: {
            'code': res.code,
            'from': 'wxe54341c3ecc826b8'
          },
          success: function (res) {
            // console.log(res.data.openid)
            wx.setStorageSync('OPENID', res.data.openid)
          },
          fail: function (res) {
            console.log('res' + res)
          }
        })
      }
    })
  },
  onshow: function (options) {

  },
  onError: function (msg) {

  },
  onPageNotFound: function (options) {

  }
})
